package com.lys.effect;

import com.lys.ExampleMod;
import com.lys.effect.beneficial.MadnessEffect;
import com.lys.effect.beneficial.PerseveranceEffect;
import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectCategory;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

public class ModEffects {

    public static final StatusEffect RESILIENCE =register( "perseverance",new PerseveranceEffect(StatusEffectCategory.BENEFICIAL, 0x00FF00));

    public static final StatusEffect MADNESS =register( "madness",new MadnessEffect(StatusEffectCategory.BENEFICIAL, 1481884)
            .addAttributeModifier(EntityAttributes.GENERIC_ATTACK_DAMAGE, "648D7064-6A60-4F59-8ABE-C2C23A6DD7A9", 3f, EntityAttributeModifier.Operation.ADDITION)
            .addAttributeModifier(EntityAttributes.GENERIC_MOVEMENT_SPEED, "91AEAA56-376B-4498-935B-2F7F68070635", 0.2f, EntityAttributeModifier.Operation.MULTIPLY_TOTAL)
            .addAttributeModifier(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, "A5F6EA24-DAD7-4C24-BB97-3F69BFAD580C", 0.2f, EntityAttributeModifier.Operation.ADDITION)
            .addAttributeModifier(EntityAttributes.GENERIC_ATTACK_SPEED, "5F9D2B13-34C7-4A20-985D-39D416D0D6FC", 0.4f, EntityAttributeModifier.Operation.ADDITION)
    );

    private static StatusEffect register(String name, StatusEffect entry) {
        return Registry.register(Registries.STATUS_EFFECT,new Identifier(ExampleMod.MOD_ID,name),entry);
    }

    public static void registerModEffects() {
        ExampleMod.LOGGER.info("Registering Mod Effects for" + ExampleMod.MOD_ID);
    }
}
